#ifndef GOSET_H
#define GOSET_H

#include <QWidget>
#include "QTimer"
#include "QPaintEvent"
#include "QPainter"
#include "QColor"

namespace Ui {
class goset;
}

class goset : public QWidget
{
    Q_OBJECT

public:
    explicit goset(QWidget *parent = nullptr);
    ~goset();
    void set_val(int val);
    void set_Text(QString);
    void set_font_size(int val);
    void set_round_color(QColor val);
    void set_round_wigth(int val);
    void set_gif(int val);//设定转动角度

    bool gif_run=0;
    int gif_start=90;

protected:
    void paintEvent(QPaintEvent *);
    virtual void mousePressEvent(QMouseEvent *event);//重写mousePressEvent事件


signals:
    //自定义clicked()信号,在mousePressEvent事件发生时触发
    void m_clicked(bool,QString);

private slots:
    void UpdateAngle();
private:
    int m_persent;//绘制的环的比例
    QTimer* m_updateTimer;
    int font_size;
    QColor round_color;
    int round_wigth;
    QString round_text;


    int gif_val=0;



private:
    Ui::goset *ui;
};

#endif // GOSET_H
